package leetcode.code0804;

import java.util.HashSet;
import java.util.Set;

import leetcode.IDebug;

public class Solution implements IDebug {

	String[] morse = new String[] { ".-", "-...", "-.-.", "-..", ".", "..-.", "--.", "....", "..", ".---", "-.-",
			".-..", "--", "-.", "---", ".--.", "--.-", ".-.", "...", "-", "..-", "...-", ".--", "-..-", "-.--",
			"--.." };

	public int uniqueMorseRepresentations(String[] words) {
		Set<String> set = new HashSet<>();
		for (String word : words) {
			char[] cs = word.toCharArray();
			StringBuffer sb = new StringBuffer();
			for (char element : cs) {
				sb.append(morse[element - 'a']);
			}
			set.add(sb.toString());
		}
		return set.size();
	}

	@Override
	public void debug4() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug3() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug2() {
		// TODO Auto-generated method stub

	}

	@Override
	public void debug1() {
		// TODO Auto-generated method stub

	}

	public static void main(String[] args) {
		// TODO Auto-generated method stub

	}

}
